package collect;

import java.util.ArrayList;
import java.util.List;

class Person{
    private String name;
    private Integer age;
    private Person parent;
    private List<Person> Children;
    public Person() {
    }

    public Person(List<Person> children) {
        Children = children;
    }

    public Person(Person parent) {
        this.parent = parent;
    }

    public Person getParent() {
        return parent;
    }

    public void setParent(Person parent) {
        this.parent = parent;
    }

    public Person(String name, Integer age) {
        this.name = name;
        this.age = age;
    }

    public List<Person> getChildren() {
        return Children;
    }

    public void setChildren(List<Person> children) {
        Children = children;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}

